home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / etc / init.d / kerneloops < prev    next >
Text File  |  2009-11-02  |  2KB  |  95 lines

  1. #!/bin/sh
  2. #
  3. # kerneloops
  4. #
  5. # chkconfig:   345 90 88
  6. # description: A tool that collects and submits kernel crash \
  7. # signatures to the kerneloops.org website for use by the Linux \
  8. # kernel developers.
  9. # processname: kerneloops
  10. # config:      /etc/kerneloops.conf
  11. #
  12. ### BEGIN INIT INFO
  13. # Provides: kerneloops
  14. # Default-Start: 2 3 4 5
  15. # Default-Stop: 1
  16. # Required-Start: $local_fs $remote_fs $named $network $time $syslog
  17. # Required-Stop: $local_fs $remote_fs $syslog
  18. # Short-Description: Tool to automatically collect and submit kernel crash signatures
  19. # Description: A tool that collects and submits kernel crash
  20. #   signatures to the kerneloops.org website for use by the Linux
  21. #   kernel developers.
  22. ### END INIT INFO
  23.  
  24. # Source function library.
  25. . /lib/lsb/init-functions
  26.  
  27.  
  28. exec="/usr/sbin/kerneloops"
  29. prog=$(basename $exec)
  30. service="Kernel Oops catching service"
  31. pidfile=/var/run/$prog.pid
  32. sconf="/etc/kerneloops.conf"
  33. enabled=1
  34.  
  35. [ -x "$exec" ] || exit 0
  36.  
  37. [ -e /etc/default/$prog ] && . /etc/default/$prog
  38.  
  39. [ "$enabled" = "1" ] || exit 0
  40.  
  41. start() {
  42.     log_daemon_msg "Starting $service" "$prog"
  43.     start-stop-daemon --start --quiet --oknodo --chuid kernoops:adm --pidfile $pidfile --exec $exec
  44.     retval=$?
  45.     pidof -s kerneloops > $pidfile
  46.     log_end_msg "$retval"
  47.     return $retval
  48. }
  49.  
  50. stop() {
  51.     log_daemon_msg "Stopping $service" "$prog"
  52.     start-stop-daemon --stop --quiet --oknodo --pidfile $pidfile
  53.     retval=$?
  54.     rm -f $pidfile
  55.     log_end_msg "$retval"
  56.     return $retval
  57. }
  58.  
  59. restart() {
  60.     stop
  61.     start
  62. }
  63.  
  64. reload() {
  65.     restart
  66. }
  67.  
  68. force_reload() {
  69.     restart
  70. }
  71.  
  72. fdr_status() {
  73.     status_of_proc -p $pidfile $prog "$service"
  74. }
  75.  
  76.  
  77. case "$1" in
  78.     start|stop|restart|reload)
  79.           $1
  80.         ;;
  81.     force-reload)
  82.         force_reload
  83.         ;;
  84.     status)
  85.         fdr_status
  86.         ;;
  87.     condrestart|try-restart)
  88.         pidof kerneloops >/dev/null || restart
  89.         ;;
  90.     *)
  91.         echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
  92.         exit 1
  93. esac
  94.  
  95.